﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Area Sparkline</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
        /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));
            initSpread(spread);
        });

        function initSpread(spread) {
            var spreadNS = GcSpread.Sheets;
            var sheet = spread.sheets[0];
            sheet.isPaintSuspended(true);

            sheet.addSpan(0, 0, 1, 5);
            sheet.getCell(0, 0).value("Sales by State").font("20px Arial").hAlign(spreadNS.HorizontalAlign.center).vAlign(spreadNS.VerticalAlign.center);
            var table1 = sheet.addTable("table1", 1, 0, 6, 5, spreadNS.TableStyles.medium4());
            table1.rowFilter().setShowFilterButton(false);
            sheet.setValue(1, 0, "State");
            sheet.setValue(1, 1, "Sale of 2012 year");
            sheet.setValue(1, 2, "Sale of 2013 year");
            sheet.setValue(1, 3, "Sale of 2014 year");
            sheet.setValue(1, 4, "Diagram");
            sheet.setValue(2, 0, "Idaho");
            sheet.setValue(2, 1, 10000);
            sheet.setValue(2, 2, -9000);
            sheet.setValue(2, 3, 15000);
            sheet.setValue(3, 0, "Montana");
            sheet.setValue(3, 1, 1000);
            sheet.setValue(3, 2, 10000);
            sheet.setValue(3, 3, 15000);
            sheet.setValue(4, 0, "Oregon");
            sheet.setValue(4, 1, 10000);
            sheet.setValue(4, 2, 7000);
            sheet.setValue(4, 3, 0);
            sheet.setValue(5, 0, "Washington");
            sheet.setValue(5, 1, 1000);
            sheet.setValue(5, 2, 10000);
            sheet.setValue(5, 3, 5000);
            sheet.setValue(6, 0, "Etah");
            sheet.setValue(6, 1, -5000);
            sheet.setValue(6, 2, 5000);
            sheet.setValue(6, 3, 12000);
            sheet.setFormatter(-1, 1, "$#,##0");
            sheet.setFormatter(-1, 2, "$#,##0");
            sheet.setFormatter(-1, 3, "$#,##0");
            sheet.setFormula(2, 4, '=AREASPARKLINE(B3:D3,,,0,10000,"yellowgreen","red")');
            sheet.setFormula(3, 4, '=AREASPARKLINE(B4:D4,,,0,10000,"yellowgreen","red")');
            sheet.setFormula(4, 4, '=AREASPARKLINE(B5:D5,,,0,10000,"yellowgreen","red")');
            sheet.setFormula(5, 4, '=AREASPARKLINE(B6:D6,,,0,10000,"yellowgreen","red")');
            sheet.setFormula(6, 4, '=AREASPARKLINE(B7:D7,,,0,10000,"yellowgreen","red")');
            sheet.setRowHeight(0, 50);
            sheet.setRowHeight(1, 25);
            for (var i = 2; i < 7; i++) {
                sheet.setRowHeight(i, 45);
            }
            sheet.setColumnWidth(0, 100);
            sheet.setColumnWidth(1, 120);
            sheet.setColumnWidth(2, 120);
            sheet.setColumnWidth(3, 120);
            sheet.setColumnWidth(4, 200);

            sheet.isPaintSuspended(false);
        };

        /*code_end*/
    </script>

</head>
<body>
<div class="sample-turtorial">
    <div id="ss" style="width:100%; height:420px;border: 1px solid gray;"></div>
</div>
</body>
</html>
